import sys
sys.path.append('.')
from abc import ABC, abstractmethod
from src.models import Task, User
from typing import List


class IDataAdapter(ABC):


    @abstractmethod
    def _load_tasks(self) -> List[Task]:
        pass

    @abstractmethod
    def _save_tasks(self, tasks:List[Task]) -> bool:
        pass

    @abstractmethod
    def _load_users(self) -> List[User]:
        pass

    @abstractmethod
    def _save_users(self, users:List[User]) -> bool:
        pass

    @abstractmethod
    def add_task(self, task:Task):
        pass

    @abstractmethod
    def select_task(self, uuid) -> Task:
        pass

    @abstractmethod
    def delete_task(self, uuid) -> bool:
        pass

    @abstractmethod
    def update_task(self, uuid, **kwarg) -> bool:
        pass

    @abstractmethod
    def search_task(self, **kwarg) -> List[Task]:
        pass

    @abstractmethod
    def add_user(self, user) -> bool:
        pass

    @abstractmethod
    def select_user(self, uuid) -> User:
        pass

    @abstractmethod
    def delete_user(self, uuid) -> bool:
        pass

    @abstractmethod
    def search_user(self, **kwarg) -> List[User]:
        pass

    @abstractmethod
    def update_user(self, uuid, **kwarg) -> bool:
        pass

    @abstractmethod
    def switch_user(self, user) -> bool:
        pass